<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>{$current['title']}-{$Think.CONFIG.title}</title>
    <meta name="keywords" content="{$Think.CONFIG.keywords}" />
    <meta name="description" content="{$Think.CONFIG.description}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <include file="Public/head" />
</head>
<body class="no-skin">
<include file="Public/header" />
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>
    <include file="Public/sidebar" />
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs" />
            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set" />
                <!-- /section:settings.box -->

                <div class="row">
                    <div class="page-content">
						<div class="page-content-area">
							<div class="row">
								<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<!--/span-->
								<!-- left menu ends -->
									<if condition="$user['level'] eq 1">
									<div style="margin-bottom: 10px;">
										<ul class="nav nav-tabs">
											<li class="active"><a href="{:U('order')}<notempty name='uid'>/uid/{$uid}</notempty>">订单统计</a></li>
											
											<li class=""><a href="{:U('members')}<notempty name='uid'>/uid/{$uid}</notempty>">用户统计</a></li>
											<li style="display: none" class=""><a href="{:U('order')}<notempty name='uid'>/uid/{$uid}</notempty>">小说统计</a></li>
											
										</ul>
									</div>
									</if>
									<if condition="$user['level'] neq 4">
									<div class="alert alert-info">
										<i class="fa fa-info-circle"></i> 通知（提现规则）：当天上午10点之前提现（昨日之前包括昨日所有可提现金额），则当天到账；若超过上午10点提现则会在提现次日到账，望各渠道合理安排提现时间，有问题第一时间找客服，我们会及时处理。沟通才能解决问题，希望我们之间合作愉快，共同盈利！
									</div>
									</if>
									<div class="row" id="order-summary-stats-panel">
										<div class="col-md-3">
											<div class="well">
												<b>
													今日充值 <i class="fa fa-question-circle" title="非实时, 延迟 1 分钟左右"></i>
													<!--<span style="font-weight:normal;font-size:13px;color:#090" class="pull-right">
														<span class="refresh_seconds_left">60</span> 秒后刷新
													</span>-->
												</b>
												<div class="text-primary" style="font-size:32px;margin:5px 0">
													¥<span class="day_money">{$now_data['money']|default='0.00'}</span>
												</div>
												<div class="container-fluid">
													<div class="row">
														<div class="col-sm-6" style="padding:0">
															<strong>普通充值</strong>
															<div><b class="text-primary basic_money">¥{$now_data['basic_money']|default='0.00'}</b></div>
															<div>已支付: <b class="text-warning basic_success_num">{$now_data['basic_success_num']|default='0'}</b> 笔</div>
															<div>未支付: <b class="text-warning basic_fail_num">{$now_data['basic_fail_num']|default='0'}</b> 笔</div>
															<!--
															<div>
																完成率: <b class="text-warning"><span class="basic_num">{$now_data['basic_num']}</span> %</b>
															</div>
															-->
														</div>
														<div class="col-sm-6" style="padding:0">
															<strong>VIP会员</strong>
															<div><b class="text-primary vip_money">¥{$now_data['vip_money']|default='0.00'}</b></div>
															<div>已支付: <b class="text-warning vip_success_num">{$now_data['vip_success_num']|default='0'}</b> 笔</div>
															<div>未支付: <b class="text-warning vip_fail_num">{$now_data['vip_fail_num']|default='0'}</b> 笔</div>
															<!--
															<div>
																完成率: <b class="text-warning"><span class="vip_num">{$now_data['vip_num']}</span> %</b>
															</div>
															-->
														</div>
													</div>
												</div>
											</div>
										</div>

										<div class="col-md-3">
											<div class="well">
												<b>昨日充值</b>
												<div class="text-primary" style="font-size:32px;margin:5px 0">
													¥<span>{$data[$yesterday]['money']|default='0.00'}</span>
												</div>
												<div class="container-fluid">
													<div class="row">
														<div class="col-sm-6" style="padding:0">
															<strong>普通充值</strong>
															<div><b class="text-primary">¥{$data[$yesterday]['basic_money']|default='0.00'}</b></div>
															<div>已支付: <b class="text-warning">{$data[$yesterday]['basic_success_num']|default='0'}</b> 笔</div>
															<div>未支付: <b class="text-warning">{$data[$yesterday]['basic_fail_num']|default='0'}</b> 笔</div>
															<!--
															<div>
																完成率: <b class="text-warning"><span>{$data[$yesterday]['basic_num']}</span> %</b>
															</div>
															-->
														</div>
														<div class="col-sm-6" style="padding:0">
															<strong>VIP会员</strong>
															<div><b class="text-primary">¥{$data[$yesterday]['vip_money']|default='0.00'}</b></div>
															<div>已支付: <b class="text-warning">{$data[$yesterday]['vip_success_num']|default='0'}</b> 笔</div>
															<div>未支付: <b class="text-warning">{$data[$yesterday]['vip_fail_num']|default='0'}</b> 笔</div>
															<!--
															<div>
																完成率: <b class="text-warning"><span>{$data[$yesterday]['vip_num']}</span> %</b>
															</div>
															-->
														</div>
													</div>
												</div>
											</div>
										</div>

										<div class="col-md-3">
											<div class="well">
												<b>本月充值 (不含当日) <i class="fa fa-question-circle" title="不含当日，非实时，每天凌晨0左右更新"></i> </b>
												<div class="text-primary" style="font-size:32px;margin:5px 0">
													¥<span>{$month_data['money']|default='0.00'}</span>
												</div>
												<div class="container-fluid">
													<div class="row">
														<div class="col-sm-6" style="padding:0">
															<strong>普通充值</strong>
															<div><b class="text-primary">¥{$month_data['basic_money']|default='0.00'}</b></div>
															<div>已支付: <b class="text-warning">{$month_data['basic_success_num']|default='0'}</b> 笔</div>
															<div>未支付: <b class="text-warning">{$month_data['basic_fail_num']|default='0'}</b> 笔</div>
															<!--
															<div>
																完成率: <b class="text-warning"><span>{$month_data['basic_num']}</span> %</b>
															</div>
															-->
														</div>
														<div class="col-sm-6" style="padding:0">
															<strong>VIP会员</strong>
															<div><b class="text-primary">¥{$month_data['vip_money']|default='0.00'}</b></div>
															<div>已支付: <b class="text-warning">{$month_data['vip_success_num']|default='0'}</b> 笔</div>
															<div>未支付: <b class="text-warning">{$month_data['vip_fail_num']|default='0'}</b> 笔</div>
															<!--
															<div>
																完成率: <b class="text-warning"><span>{$month_data['vip_num']}</span> %</b>
															</div>
															-->
														</div>
													</div>
												</div>
											</div>
										</div>
										<div class="col-md-3">
											<div class="well">
												<b>累计充值 (不含当日) <i class="fa fa-question-circle" title="不含当日，非实时，每天凌晨0左右更新"></i> </b>
												<div class="text-primary" style="font-size:32px;margin:5px 0">
													¥<span>{$count_data['money']}</span>
												</div>
												<div class="container-fluid">
													<div class="row">
														<div class="col-sm-6" style="padding:0">
															<strong>普通充值</strong>
															<div><b class="text-primary">¥{$count_data['basic_money']|default='0.00'}</b></div>
															<div>已支付: <b class="text-warning">{$count_data['basic_success_num']|default='0'}</b> 笔</div>
															<div>未支付: <b class="text-warning">{$count_data['basic_fail_num']|default='0'}</b> 笔</div>
															<!--
															<div>
																完成率: <b class="text-warning"><span>{$count_data['basic_num']}</span> %</b>
															</div>
															-->
														</div>
														<div class="col-sm-6" style="padding:0">
															<strong>VIP会员</strong>
															<div><b class="text-primary">¥{$count_data['vip_money']|default='0.00'}</b></div>
															<div>已支付: <b class="text-warning">{$count_data['vip_success_num']|default='0'}</b> 笔</div>
															<div>未支付: <b class="text-warning">{$count_data['vip_fail_num']|default='0'}</b> 笔</div>
															<!--
															<div>
																完成率: <b class="text-warning"><span>{$count_data['vip_num']}</span> %</b>
															</div>
															-->
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>

									<div class="panel panel-default" id="order-daily-stats-panel">
										<div class="panel-heading">
											<h3 class="panel-title"><i class="fa fa-calendar"></i> 近30天充值统计</h3>
										</div>
										<div class="loading-panel" data-bind="visible: loading" style="display: none;">
											<i class="fa fa-spinner fa-spin"></i>
										</div>
										<table class="table table-bordered table-striped">
											<thead>
												<tr>
													<th>日期</th>
													<th class="text-right">充值金额</th>
													<th class="text-right">普通充值</th>
													<th class="text-right">普通充值支付订单数</th>
													<th class="text-right">VIP会员</th>
													<th class="text-right">VIP会员支付订单数</th>
												</tr>
											</thead>
											<tbody data-bind="foreach: stats">
												<volist name="data" id="val">
												<tr>
													<td><span>{$key}</span></td>
													<td class="text-right">
														<b>¥ <span>{$val['money']}</span></b>
													</td>
													<td class="text-right">
														<b>¥ <span>{$val['basic_money']}</span></b>
														<div class="text-muted" style="font-size:13px;margin-top:5px">
															充值人数: <span>{$val['basic_success_number']}</span>,
															人均: ¥ <span>{$val['basic_ratio']}</span>
														</div>
													</td>
													<td class="text-right">
														<b><span>{$val['basic_success_num']}</span> 笔</b>
														<div class="text-muted" style="font-size:13px;margin-top:5px">
															<span>{$val['basic_fail_num']}</span> 笔未支付<!--,
															完成率: <span>{$val['basic_num']}</span> %-->
														</div>
													</td>
													<td class="text-right">
														<b>¥ <span>{$val['vip_money']}</span></b>
														<div class="text-muted" style="font-size:13px;margin-top:5px">
															充值人数: <span>{$val['vip_success_number']}</span>,
															人均: ¥ <span>{$val['vip_ratio']}</span>
														</div>
													</td>
													<td class="text-right">
														<b><span>{$val['vip_success_num']}</span> 笔</b>
														<div class="text-muted" style="font-size:13px;margin-top:5px">
															<span>{$val['vip_fail_num']}</span> 笔未支付<!--,
															完成率: <span>{$val['vip_num']}</span> %-->
														</div>
													</td>
												</tr>
												</volist>
											</tbody>
										</table>
									</div>
									<!-- PAGE CONTENT ENDS -->
								</div><!-- /.col -->
							</div><!-- /.row -->
						</div><!-- /.page-content-area -->
					</div>
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer" />
</div><!-- /.main-container -->
<include file="Public/footerjs" />
<!-- inline scripts related to this page -->
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script type="text/javascript">
	var uid = '{$uid}';
    var time = 60;
	$(function () {
		$('.date_keyword').datepicker({
            format: 'yyyy-mm-dd',
            weekStart: 1,
            autoclose: true,
            todayBtn: 'linked',
            language: 'cn'
        });
		refresh();
	});
	
	function refresh(){
		return ;
		time--;
		$('.refresh_seconds_left').html(time);
		if(time==0){
			time = 60;
			$.post("{:U('day_order')}" , {uid :uid} , function(data){
				$('.day_money').html(data.money);
				$('.vip_num').html(data.vip_num);
				$('.basic_num').html(data.basic_num);
				$('.vip_money').html(data.vip_money);
				$('.basic_money').html(data.basic_money);
				$('.basic_success_num').html(data.basic_success_num);
				$('.vip_success_num').html(data.vip_success_num);
				$('.basic_fail_num').html(data.basic_fail_num);
				$('.vip_fail_num').html(data.vip_fail_num);
			},'json');
		}
		setTimeout(refresh,1000);
	}
	/**
	* 导出下级
	**/
	function download_excel(uid){
		var startime = $("input[name=start_date]").val();
        var endtime = $("input[name=end_date]").val();
		var url = "{:U('download_excel')}"+"?uid="+uid+'&start_date='+startime+'&end_date='+endtime;
		window.open(url);
	}
</script>
</body>
</html>